//
//  NaviViewController.m
//  拖小延闹钟
//
//  Created by rimi on 15/10/12.
//  Copyright (c) 2015年 Liukai. All rights reserved.
//

#import "NaviViewController.h"

@interface NaviViewController ()

@end

@implementation NaviViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIImageView *myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), 75)];
    myImageView.userInteractionEnabled = YES;
    myImageView.backgroundColor = [UIColor clearColor];
    [self.view addSubview:myImageView];
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(135, 25, 100, 40)];
    titleLabel.font = [UIFont systemFontOfSize:25];
    titleLabel.text = self.theTitle;
    [myImageView addSubview:titleLabel];
    
    self.backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.backButton.frame = CGRectMake(5, 20, 60, 50);
    [self.backButton setBackgroundImage:[UIImage imageNamed:self.imageName] forState:UIControlStateNormal];
    [self.backButton addTarget:self action:@selector(handleEvent:) forControlEvents:UIControlEventTouchUpInside];
    [myImageView addSubview:self.backButton];
}

- (void)handleEvent:(UIButton *)sender {
    [self.navigationController popViewControllerAnimated:YES];
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
